﻿using System;
using System.ComponentModel.DataAnnotations;

namespace DrawTools.Tools
{
    [AttributeUsage(AttributeTargets.Field)]
    public class ItemVisable : Attribute
    {
        public bool Visable { get; set; }

        public ItemVisable(bool visable)
        {
            Visable = visable;
        }
    }

    public class SerializerTypeAttribute : Attribute
    {
        public Type Type { get; set; }
        /// <summary>
        /// </summary>
        /// <param name="type"></param>

        public SerializerTypeAttribute(Type type)
        {
            this.Type = type;
        }
    }

    /// <summary>
    /// 画图工具类型
    /// </summary>
    public enum DrawToolType
    {
        /// <summary>
        /// 指针（拾取）
        /// </summary>
        [Display(Name = "拾取")] Pointer = 0,

        /// <summary>
        /// 橡皮擦
        /// </summary>
        [Display(Name = "橡皮擦")] Eraser = 1,

        /// <summary>
        /// 画笔
        /// </summary>
        [Display(Name = "画笔"), ItemVisable(true)] Pen = 2,

        /// <summary>
        /// 直线
        /// </summary>
        [Display(Name = "直线"), ItemVisable(true)] Line = 3,

        /// <summary>
        /// 箭头
        /// </summary>
        [Display(Name = "箭头"), ItemVisable(true)] Arrow = 4,

        /// <summary>
        /// 矩形
        /// </summary>
        [Display(Name = "矩形"), ItemVisable(true)] Rectangle = 5,

        /// <summary>
        /// 椭圆
        /// </summary>
        [Display(Name = "椭圆"), ItemVisable(true)] Ellipse = 6,

        /// <summary>
        /// 角度
        /// </summary>
        [Display(Name = "角度"), ItemVisable(true)] Angle = 7,

        /// <summary>
        /// 长度测距
        /// </summary>
        [Display(Name = "长度"), ItemVisable(false)] Ranging = 8,

        /// <summary>
        /// 线段
        /// </summary>
        [Display(Name = "长度"), ItemVisable(true)] Length = 9,

        /// <summary>
        /// 折线
        /// </summary>
        [Display(Name = "折线"), ItemVisable(true)] Polyline = 10,

        /// <summary>
        /// 曲线
        /// </summary>
        [Display(Name = "曲线"), ItemVisable(true)] Curve = 11,

        /// <summary>
        /// 多边形
        /// </summary>
        [Display(Name = "多边形"), ItemVisable(true)] Polygon = 12,

        /// <summary>
        /// 闭合曲线
        /// </summary>
        [Display(Name = "闭合曲线"), ItemVisable(false)] ClosedCurve = 13,

        /// <summary>
        /// 闭合线条
        /// </summary>
        [Display(Name = "闭合线条"), ItemVisable(false)] ClosedLine = 14,

        /// <summary>
        /// 闭合线条:含面积
        /// </summary>
        [Display(Name = "闭合线条:含面积"), ItemVisable(true)] AreaClosedLine = 15,

        /// <summary>
        /// 面积
        /// </summary>
        [Display(Name = "面积"), ItemVisable(true)] Area = 16,

        /// <summary>
        /// 文字
        /// </summary>
        [Display(Name = "文字")] Text = 17,

        /// <summary>
        /// 长度校准
        /// </summary>
        [Display(Name = "长度校准")] Check = 18,
    }
}